home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
YERK
/
SUPPLEME
/
MY_STUFF
/
VBLS
< prev
next >
Wrap
Text File
|
1991-04-29
|
1KB
|
57 lines
\ 4.6.87 rfl vbl queue manipulation
\ 1.1.88 rfl general cleanup
:code vinstall
move.l (a7)+,a0
call vinstall
ext.l d0
move.l d0,-(a7)
;code
:code vremove
move.l (a7)+,a0
call vremove
ext.l d0
move.l d0,-(a7)
;code
:CLASS vbl <super object
var qlink
int qtype
var procPtr
int vblCount
int vblPhase
( 1/60ths of second -- )
:M SetDelay: put: vblCount ;M
( cfaProc -- errcode)
:M install: >body +base put: procptr abs: self vinstall abort" install error" ;M
( -- errcode)
:M remove: abs: self vremove . ;M
:M classinit: 1 put: qtype ;M
;class
vbl myTask
\ Now to use this, create a :proc definition which is the background task
\ you want to perform. You can set the delay (in 1/60ths
\ of a second) for periodic execution using the setDelay: method. The
\ task itself must reset this delay everytime it executes. The task
\ should ultimately be written in assembly, since all other events
\ are on hold while your word is being executed.
\ example below
\ :Proc beeper 1 beep 120 setdelay: myTask ;proc
\ 120 setdelay: myTask
\ 'c beeper install: myTask
\ to remove, say remove: myTask